package com.dykj.fireFighting.web.rocketmq.consumer;

import com.dykj.fireFighting.api.elasticsearch.devHisZc.service.EsDevHisZcService;
import com.dykj.fireFighting.api.socialUnit.devicemanger.service.IDeviceService;
import com.dykj.fireFighting.common.starter.redisson.service.RedisService;
import com.dykj.fireFighting.web.model.report.DevHisSs;
import com.dykj.fireFighting.web.rocketmq.message.InsertDevHisSsMessage;
import com.dykj.fireFighting.web.rocketmq.message.InsertDevHisZcMessage;
import com.dykj.fireFighting.web.service.DevHisZcService;
import com.dykj.fireFighting.web.service.IDevHisSsService;
import com.dykj.fireFighting.web.utils.SpringUtil;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Author: zly
 * @Description : 盛善
 * @Date: 2021-11-30
 */
/*@RocketMQMessageListener(
        topic = InsertDevHisSsMessage.TOPIC,
        consumerGroup = "dy-consumer-group-" + InsertDevHisSsMessage.TOPIC
)*/
public class InsertDevHisSsConsummer implements RocketMQListener<InsertDevHisSsMessage> {
    public static final Logger LOGGER = LoggerFactory.getLogger(InsertDevHisZcConsumer.class);
    private static final RedisService redisService= SpringUtil.getBean(RedisService.class);
    private static final IDevHisSsService devHisSsService= SpringUtil.getBean(IDevHisSsService.class);
    //private static final EsDevHisZcService esDevHisZcService= SpringUtil.getBean("esDevHisZcService");
    @Override
    public void onMessage(InsertDevHisSsMessage insertDevHisSsMessage) {
        DevHisSs devHisSs = insertDevHisSsMessage.getDevHisSs();
        devHisSsService.insertDevHisSs(devHisSs);


    }
}
